package com.szrt.seller.base;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import com.google.gson.Gson;

public class JsonUtil {
	
	public static void WriterToJson(Object obj,HttpServletResponse resp){
		
		try {
			
		   Gson json=new Gson();
		   String jsonString = json.toJson(obj);
		   PrintWriter writer;
		   writer = resp.getWriter();
		   writer.write(jsonString);
		   
		} catch (IOException e) {
			e.printStackTrace();
		}
		   
	}

}
